home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue46 / Clinic / AutomationServer2MainFormU.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1999-03-15  |  811 b   |  42 lines

  1. unit AutomationServer2MainFormU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TFrmServer = class(TForm)
  11.     Label1: TLabel;
  12.     procedure FormCreate(Sender: TObject);
  13.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   FrmServer: TFrmServer;
  22.  
  23. implementation
  24.  
  25. uses
  26.   ComServ, ComObj, AutomationServer2_TLB;
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TFrmServer.FormCreate(Sender: TObject);
  31. begin
  32.   Application.ShowMainForm := ComServer.StartMode <> smAutomation;
  33. end;
  34.  
  35. procedure TFrmServer.FormClose(Sender: TObject; var Action: TCloseAction);
  36. begin
  37.   if Tag <> 0 then
  38.     (TComObject(Tag) as IClock).Quit
  39. end;
  40.  
  41. end.
  42.